﻿using System;

namespace housingsafety.server.Helpers
{
    /// <summary>
    /// Redis主键
    /// </summary>
    public class ConstRedisKeys
    {
        /// <summary>
        /// 用户行为监测
        /// </summary>
        public const int UserBehaviorCache = 4;

        /// <summary>
        /// 默认缓存空间
        /// </summary>
        public const string DefaultNamespace = "ns";

        /// <summary>
        /// 短信验证码
        /// </summary>
        public static string SmsCode(string userNumber) { return $"dm:sms.code:{userNumber}:string"; }

        /// <summary>
        /// 刷新Token
        /// </summary>
        /// <param name="refreshToken">刷新Token</param>
        /// <returns>刷新Token</returns>
        public static string RefreshTokens(string refreshToken) { return $"dm:refresh.token:{refreshToken}:UserRefreshToken"; }

        /// <summary>
        /// 二维码主键
        /// </summary>
        /// <param name="qrGuid"></param>
        /// <returns></returns>
        public static string QrCode(string qrGuid) { return $"dm:qr.code:{qrGuid}:string"; }

        /// <summary>
        /// 用户角色缓存
        /// </summary>
        /// <param name="userNumber">用户</param>
        /// <returns></returns>
        public static string UserRoles(string userNumber) { return $"dm:role.set:{userNumber}:UserRoleSet"; }
    }
}
